package cn.edu.zxj.rabbitmqmyself.model.compile.and.run;

import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Description：该类用来提供存储编译和运行任务的响应结果
 *
 * @author: zxj
 * @date: 2024-10-02
 * @time: 00:50:55
 */
@Data
public class Response {
    /*
     * 需求分析:
     * 1. 该类需要提供三个字段, 用来存储编译和运行的结果
     * 2. 状态码, 运行结果, 错误信息
     */
    private Integer code; // 状态码, 0 表示成功, 1 表示编译失败, 2 表示运行失败
    private String reason;
    private String stdout;
    private String stderr;

    public static Response error(String reason) {
        Response response = new Response();
        response.setCode(3);
        response.setReason(reason);
        return response;
    }
}
